#include <iostream>
#include <vector>

using namespace std;

class Point
{
public:
  Point( int xx, int yy ) : x(xx), y(yy) { }
  
  int x;
  int y;
};

bool is_same_side( vector< Point >& points, size_t i )
{
  size_t j = ( i + 1 ) % points.size();
  size_t t = (i == 0?points.size()-1:i-1);
  size_t s = ( i + 2 ) % points.size();
  if( points[i].x == points[j].x ){
	return (points[t].y > points[i].y) == (points[s].y > points[i].y);
  }
  
  float k = ( points[j].y - points[i].y ) / ( points[j].x - points[i].x );
  float b = points[i].y - k * points[i].x;

  return ( ( points[s].y - k * points[s].x - b ) > 0 ) == ( ( points[t].y - k * points[t].x - b ) > 0 );
}

bool is_hull_convex( vector< Point >& points )
{
  for( size_t i = 0; i < points.size(); i++ ) {
    if( !is_same_side( points, i ) )
      return false;
  }

  return true;
}

int main()
{
  vector< Point > vp;
  vp.push_back( Point( -1, 0 ) );
  vp.push_back( Point( 0, 1 ) );
  vp.push_back( Point( 1, 0 ) );
  vp.push_back( Point( 1, -1 ) );
  vp.push_back( Point( -1, -2 ) );
  vp.push_back( Point( 0, -1 ) );
  
  cout << is_hull_convex( vp ) << endl;
  
  return 0;
}
